<template>
  <div>
    <n-spin :show="show" description="请稍候...">
      <n-card :bordered="false" :header-style="{
                    padding: '20px',
                  }">
        <template #header>
          <text style="font-weight: 500;font-size: 18px;color: #3D3D3D;line-height: 25px;">分销订单</text>
        </template>
        <n-tabs type="card" animated>
          <n-tab-pane name="酒店订单" tab="酒店订单">
            <FoodOrderLog ref="foodOrderLogRef"/>
          </n-tab-pane>
        </n-tabs>
      </n-card>
    </n-spin>
  </div>
</template>

<script lang="ts" setup>
  import { ref, onMounted } from 'vue';
  import { useMessage } from 'naive-ui';
  import { getConfig, updateConfig } from '@/api/sys/config';
  import {useProjectSettingStore} from "@/store/modules/projectSetting";
  import BookingNotice from "@/views/spaOther/booking_notice.vue";
  import TimeTips from "@/views/spaOther/time_tips.vue";
  import CarOrderLog from "@/views/logManage/car_order_log.vue";
  import FoodOrderLog from "@/views/fxOrder/food_order_log.vue";
  import SpaOrderLog from "@/views/logManage/spa_order_log.vue";

  const group = ref('spaothersetting');
  const show = ref(false);
  const message = useMessage();
  const formBtnLoading = ref(false);
  const settingStore = useProjectSettingStore();
  const bookingNoticeRef = ref();
  const timeTipsRef = ref();
  const carOrderLogRef = ref();
  const foodOrderLogRef = ref();
  const spaOrderLogRef = ref();

  const formValue = ref({
    bookingNotice_zh: '',
    bookingNotice_en: '',
    bookingNotice_ja: '',
    bookingNotice_ko: '',
    bookingNotice_zh_CN: '',
  });

  onMounted(() => {
    load();
  });

  function load() {
    show.value = true;
    new Promise((_resolve, _reject) => {
      getConfig({ group: group.value })
        .then((res) => {
          if(res.list){
            formValue.value = res.list;
          }
          show.value = false;
        }).catch((err)=>{
          show.value = false;
        })
    });
  }
</script>
